package com.jin.gulimall.search.controller;

import com.jin.gulimall.search.service.SearchService;
import com.jin.gulimall.search.vo.SearchParm;
import com.jin.gulimall.search.vo.SearchResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class SearchController {

    @Autowired
    SearchService searchService;

    @GetMapping("/list.html")
    public String listPage(SearchParm searchParm, Model model){
        SearchResult result=searchService.search(searchParm);
        model.addAttribute("result",result);
        return "list";
    }
}
